<?php

declare(strict_types=1);

namespace App\Service\Question;

use App\Repository\Question\QuestionGroupRepository;
use App\Service\IService;
use Hyperf\Collection\Arr;

/**
 * @extends IService<QuestionGroupRepository>
 */
final class QuestionGroupService extends IService
{
    public function __construct(
        protected readonly QuestionGroupRepository $repository,
    ) {}


    public function assignTeacher($id, $teacher_ids)
    {
        $entity = $this->repository->findById($id);
        $entity->teachers()->sync($teacher_ids);
    }
}
